#include <iostream>
#include <cmath>
#include<vector>
using namespace std;

long long solution()
{
    long long sum = 0;
    int n = 0;
    cin >> n;
    vector<int> arr;
    for (int i = 0; i < n; ++i)
    {
        int nums = 0;
        cin >> nums;
        arr.push_back(nums);
    }
    for (int i = 0; i < n; ++i)
    {
        for (int j = i + 1; j < n; ++j)
        {
            sum += (arr[i] * arr[j]);
        }
    }
    return sum;
}

int main() {
    long long ret = solution();
    cout << ret << endl;
    return 0;
}